home *** CD-ROM | disk | FTP | other *** search
/ Epson Stylus Color 600 / EPSON Stylus Color 600.iso / pc / english / answers / program / xtras / labeldrv.txt < prev    next >
Encoding:
Internet Message Format  |  1995-01-09  |  3.1 KB

  1. Date:   7/27/94
  2. ====
  3.  
  4. Name:   LabelDrv
  5. ====
  6.  
  7. Environment:
  8. ===========
  9.         Director 4.0 for Windows XObject.
  10.  
  11. Author: Greg Yachuk
  12. ======  3773 20th Street
  13.         San Francisco, CA 94110
  14.         greggy@shell.portal.com
  15.  
  16. Usage:
  17. =====
  18.  
  19. Quite often, you want to leave your content on a CDROM, because it would
  20. take too much room on a hard disk. However, you want your projector to
  21. be on the hard drive so that it loads quicker.
  22.  
  23. This leaves you with the problem of identifying the CDROM drive at run time.
  24. DOS refers to all mounted drives by drive letter, but does not guarantee
  25. what the letter will be between configurations.
  26.  
  27. LabelDrv helps you identify your drive, by making use of the Volume Label
  28. which placed on the CDROM. DOS allows certain special files at the root
  29. level to be designated as Volume Labels. This XObject will search a set
  30. of drive letters for a volume label that matches the one passed in.
  31.  
  32. If intervening drive letters don't exist, or if media is not mounted, the
  33. drive letters will be skipped over. There will be a timeout period, but the
  34. user will not be presented with a dialog box.
  35.  
  36.  
  37. Description:
  38. ===========
  39.  
  40. Method: mNew          --Creates a new instance of the XObject.
  41.         ----
  42. Params: none
  43. Return: Object handle
  44. Notes:  none
  45.  
  46.  
  47. Method: mDispose      --Disposes of XObject instance.
  48.         --------
  49. Params: none
  50. Return: none
  51. Notes:  none
  52.  
  53.  
  54. Method: mSetRange     --Sets the drive letters to begin and end the search
  55.         ---------     --for the label. Default is C..Z.
  56. Params: StartAt (string) => First character is the drive letter to start at.
  57.         EndAt   (string) => First character is the drive letter to end at.
  58. Return: none
  59. Notes:  The first character of each string is used as the drive letters
  60.         which bound the search for a volume label. No error checking is
  61.         done on these values.
  62.  
  63.         You need to ensure that the characters are alphabetic and that
  64.         StartAt is less than EndAt.
  65.  
  66.         The input parameters are not case sensitive.
  67.  
  68.  
  69. Method: mGetDrive     --Return the drive letter where the specified label
  70.         ---------     --is mounted.
  71. Params: Label   (string) => Volume label to be searched for.
  72. Return: String containing the DOS drive letter where the volume label was found.
  73. Notes:  none
  74.  
  75.  
  76. Example:
  77. =======
  78.  
  79. on startMovie
  80.   --
  81.   -- Load the XObject
  82.   --
  83.   openXlib "LabelDrv"
  84.  
  85.   --
  86.   -- Instantiate an object
  87.   --
  88.   set ld = LabelDrv(mNew)
  89.  
  90.   --
  91.   -- Machines in Japan use Drive A as the hard drive. Start looking here.
  92.   --
  93.   ld(mSetRange, "A", "Z")
  94.  
  95.   --
  96.   -- Look for a drive with "MY GAME" as the Volume Label.
  97.   --
  98.   set drive = ld(mGetDrive, "My Game")
  99.  
  100.   --
  101.   -- Set up a string pointing to the movie's directory, but on the CDROM
  102.   -- rather than on the hard disk.
  103.   --
  104.   set CDROMPath = the moviePath
  105.   set char 1 of CDROMPath = char 1 of drive
  106.  
  107.   --
  108.   -- Use the searchPath to make sure we always look relative to the CDROM.
  109.   --
  110.   setAt the searchPath, 1, CDROMPath
  111.   set the searchCurrentFolder = FALSE
  112.  
  113.   --
  114.   -- Clean up after ourselves.
  115.   --
  116.   ld(mDispose)
  117.  
  118. end startMovie
  119.